#!/usr/bin/env bash

echo $1;

case $1 in
    1)
    echo "build"
    mvn clean package
    ;;
    2)
    echo "run without provider"
    java -cp ./exchange-rate-api/target/exchange-rate-api-1.0.0-SNAPSHOT.jar:./exchange-rate-app/target/exchange-rate-app-1.0.0-SNAPSHOT.jar com.baeldung.rate.app.MainApp
    ;;
    3)
    echo "run with provider"
    java -Djava.ext.dirs=$JAVA_HOME/jre/lib/ext:./exchange-rate-impl/target:./exchange-rate-impl/target/depends -cp ./exchange-rate-api/target/exchange-rate-api-1.0.0-SNAPSHOT.jar:./exchange-rate-app/target/exchange-rate-app-1.0.0-SNAPSHOT.jar com.baeldung.rate.app.MainApp
    ;;
    *) echo "do nothing"
    echo "$0 1 = build"
    echo "$0 2 = run without provider"
    echo "$0 3 = run with provider"
    ;;
esac